package xuegao.study.mall.admin.feign;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.model.job.SysJob;

@FeignClient(name = "study-job-service", path = "/job2")
public interface JobClient {

    @ApiOperation("新增任务")
    @PostMapping(value = "/addJob")
    CommonResult addJob(@RequestBody SysJob sysJob);

    @ApiOperation("删除任务")
    @PostMapping(value = "/deleteJob")
    CommonResult deleteJob(@RequestParam(value = "id") Long id);

    @ApiOperation("修改定时表达式")
    @PostMapping("/reScheduleJob/{id}")
    CommonResult updateByBean(@PathVariable Long id, @RequestParam String jobCron, @RequestParam String jobDescribe);

    @ApiOperation("变更任务执行状态")
    @PostMapping(value = "/changeState/{id}")
    CommonResult changeState(@PathVariable Long id);

    @ApiOperation("任务列表")
    @RequestMapping(value = "/queryList", method = RequestMethod.GET)
    CommonResult queryList();
}
